System and program for result set management

ABSTRACT

Disclosed is a technique for result set management. One or more result sets are stored. Each result set was generated by executing a query. When at least one of a number of result sets that may be stored and a number of bucket tables that may hold result sets is modified, it is determined whether any of the one or more result sets are to be removed. When it is determined that one or more of the result sets are to be removed, those result sets are removed.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of and claims the benefit ofapplication Ser. No. 10/654,807, filed Sep. 3, 2003, “METHOD, SYSTEM,AND PROGRAM FOR RESULT SET MANAGEMENT”, the entire contents of which isincorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention is related to result set management (e.g., in adata store).

2. Description of the Related Art

A database system is one in which data is stored, retrieved, andprocessed. Data records in a relational database management system(RDBMS) in a computer are maintained in tables, which are a collectionof rows all having the same columns. Each column maintains informationon a particular type of data for the data records which comprise therows. Tables in the database are searched using, for example, aStructured Query Language (SQL), which specifies search operations orpredicates to perform on columns of tables in the database to qualifyrows in the database tables that satisfy the search conditions.

Relational DataBase Management System (RDBMS) software using aStructured Query Language (SQL) interface is well known in the art. TheSQL interface has evolved into a standard language for RDBMS softwareand has been adopted as such by both the American National StandardsInstitute (ANSI) and the International Standards Organization (ISO).

Given a database system in which queries are performed, it is difficultto manage saving and removing of the results of the queries. The resultsmay also be referred to as “result sets.” Each record is identified by aunique key. A record is formed from a set of table(s). The results maybe saved in cache, but are eventually, and usually quickly, removed fromthe database system and replaced with new results. Therefore, if a userwants to later obtain the result set for a point in time withoutre-executing a query, the user is typically unable to do so.

Therefore, there is a need in the art for an improved technique forresult set management.

SUMMARY OF THE INVENTION

Provided are a system and program for result set management. One or moreresult sets are stored. Each result set was generated by executing aquery. When at least one of a number of result sets that may be storedand a number of bucket tables that may hold result sets is modified, itis determined whether any of the one or more result sets are to beremoved. When it is determined that one or more of the result sets areto be removed, those result sets are removed.

BRIEF DESCRIPTION OF THE DRAWINGS

Referring now to the drawings in which like reference numbers representcorresponding parts throughout:

FIG. 1 illustrates, in a block diagram, a computing environment inaccordance with certain implementations of the invention.

FIG. 2 illustrates a Next Set Id table in accordance with certainimplementations of the invention.

FIG. 3 illustrates a Buckets Definition table in accordance with certainimplementations of the invention.

FIG. 4 illustrates columns and type of field data for a Result SetsTable of Contents in accordance with certain implementations of theinvention.

FIG. 5 illustrates a Bucket table in accordance with certainimplementations of the invention.

FIG. 6 illustrates an Input Structure table in accordance with certainimplementations of the invention.

FIG. 7 illustrates a Deletion Structure table in accordance with certainimplementations of the invention.

FIG. 8 illustrates a Drop Bucket table in accordance with certainimplementations of the invention.

FIG. 9 illustrates a Statistics table in accordance with certainimplementations of the invention.

FIG. 10 illustrates logic implemented in a pre-load/non-initializationcomponent for preload initialization in accordance with certainimplementations of the invention.

FIGS. 11A, 11B, and 11C illustrate logic implemented in apre-load/non-initialization component to perform non-initializationprocessing in accordance with certain implementations of the invention.

FIG. 12 illustrates logic implemented in a master component for serverinitialization in accordance with certain implementations of theinvention.

FIGS. 13A, 13B, and 13C illustrates logic implemented in an insertresult set component and in insertion processes in accordance withcertain implementations of the invention.

FIGS. 14A and 14B illustrate logic implemented in a delete result setcomponent 140 and in deletion processes spawned by the delete result setcomponent in accordance with certain implementations of the invention.

FIGS. 15A and 15B illustrate logic implemented in a drop table componentin accordance with certain implementations of the invention.

FIG. 16 illustrates an architecture of a computer system that may beused in accordance with certain implementations of the invention.

DETAILED DESCRIPTION

In the following description, reference is made to the accompanyingdrawings which form a part hereof and which illustrate severalimplementations of the present invention. It is understood that otherimplementations may be utilized and structural and operational changesmay be made without departing from the scope of the present invention.

FIG. 1 illustrates, in a block diagram, a computing environment inaccordance with certain implementations of the invention. A clientcomputer 100 is connected via a network 190 to a server computer 120.The client computer 100 may comprise any computing device known in theart, such as a server, mainframe, workstation, personal computer, handheld computer, laptop telephony device, network appliance, etc. Thenetwork 190 may comprise any type of network, such as, for example, aStorage Area Network (SAN), a Local Area Network (LAN), Wide AreaNetwork (WAN), the Internet, an Intranet, etc. The client computer 100includes system memory 104, which may be implemented in volatile and/ornon-volatile devices. One or more client applications 110 may execute inthe system memory 104.

The server computer 120 includes system memory 122, which may beimplemented in volatile and/or non-volatile devices. A data store engine130 executes in the system memory 122. A result set manager 132 executesas part of the data store engine 130. In certain implementations of theinvention, the result set manager 132 includes apre-load/non-initialization component 134, a master component 136, aninsert result set component 138, a delete result set component 140, anda drop table component 142. Although components 134, 136, 138, 140, and142 are illustrated as separate components within a result set manager132, the functionality of the components 134, 136, 138, 140, and 142 maybe implemented in fewer or more or different components thanillustrated. Additionally, the functionality of the components 134, 136,138, 140, and 142 may be implemented at a Web application servercomputer or other server computer that is connected to the servercomputer 120. Additionally, one or more server applications 160 executein system memory 122.

The server computer 120 provides the client computer 100 with access todata in a data store 170 (e.g., a database). Although a single datastore 170 is illustrated for ease of understanding, tables 150 and otherdata in data store 170 may be stored in data stores at other computersconnected to server computer 120. Also, an operator console 180 executesone or more applications 182 and is used to access the server computer120 and the data store 170. Although tables 150 are referred to hereinfor ease of understanding, other types of structures may be used to holdthe data that is described as being stored in tables 150.

The data store 170 may comprise an array of storage devices, such asDirect Access Storage Devices (DASDs), Just a Bunch of Disks (JBOD),Redundant Array of Independent Disks (RAID), virtualization device, etc.The data store 170 includes tables 150 that are used withimplementations of the invention.

FIG. 2 illustrates a Next Set Id table 200 in accordance with certainimplementations of the invention. The Next Set Id table 200 has columnsfor Next_Set_Id and Number_of_Set_Ids, each of which may be a numericfield. The Next Set Id table 200 indicates how many result sets may besaved and identifies the next set id to use for saving a result set.Once the maximum number of result sets is reached, then the next set idvalue wraps around to the beginning of the possible values. For example,if 100 is the maximum number of result sets, and 0-99 are the availablevalues, then, after 99, the next set id wraps around to 0. In certainimplementations of the invention, the Next Set Id table 200 consists ofone row, and the Next_Set_Id starts from 0.

FIG. 3 illustrates a Buckets Definition table 300 in accordance withcertain implementations of the invention. The Buckets Definition table300 has a column for the prefix of the table (Bucket_Prefix) for eachbucket and a column for the number of buckets (Number_of_Buckets). TheBuckets Definition table 300 controls whether all result sets are savedin one bucket table or multiple bucket tables. Each bucket table(further described with respect to FIG. 5) stores one or more resultsets. In certain implementations, the Buckets Definition table 300consists of one row with the prefix and the number of buckets.

In certain implementations, concatenating the value of the Bucket_Prefixwith the bucket number (i.e., the value of Number_of_Buckets) forms thename of the bucket table. In certain implementations of the invention,the first bucket is 0. For example, if the Bucket_Prefix is “RS_” andthe Number_of_Buckets is “2”, then two bucket tables named RS_(—)0 andRS_(—)1 are created. Bucket_Prefix may be a character field andNumber_of_Buckets may be a numeric field. The length of a table name ina data store 170 has a size limit and therefore the Bucket_Prefixconcatenated with the maximum bucket number which is Number_of_Buckets−1must be less than or equal to this limit.

FIG. 4 illustrates columns and type of field data for a Result SetsTable of Contents 400 in accordance with certain implementations of theinvention. The Results Sets Table of Contents 400 includes a row foreach existing result set. The Results Sets Table of Contents 400 hascolumns for Set_Id, Current_Set_Id, Bucket_Table, Current_Bucket_Table,Owned_By, Set_Name, Set_Description, Created_Ts, Query, Set_Count, andSaved_Complete_Flag.

There may be a unique index on the Set_Id column, which provides aresult set identifier. Current_Set_Id refers to the result setidentifier associated with the result set for which the row was created.Set_Id is equal to Current_Set_Id when the system is initialized. If thenumber of result sets is decreased (i.e., Number_of_Set_Ids isdecreased), then Set_Id may be updated, while Current_Set_Id is notupdated. Therefore, Set_Id may be different from Current_Set_Id, whilethe result set has not been reused. Once the result set is reused, thenSet_Id is equal to Current_Set_Id.

Bucket_Table identifies the table in which a result set is stored. Ifthe number of buckets (Number_of_Buckets) changes, then Bucket_Table maybe updated, while Current_Bucket_Table is not updated. Therefore,Bucket_Table and Current_Bucket_Table are not equal if the bucket tableassociated to a given Set_Id modulo the total number of buckets changes,the Set_Id will go into when the Set_Id is reused. Otherwise,Bucket_Table and Current_Bucket_Table are equal.

When a result set is completely saved in a bucket table, then theSaved_Complete_Flag is set to a first value (e.g., one), otherwise theSaved_Complete_Flag is set to a second value (e.g., zero). Set_Countindicates how many records have been saved for a result set. When theSaved_Complete_Flag is equal to the first value (e.g., one), thenSet_Count represents how many records are in a result set. Owned_By isset to the identity of the person who created the result set. Set_Nameis the result set's name, and, in certain implementations, Set_Name is Sappended by the Current_Set_Id. For example, a result set name may be“S0” when the Current_Set_Id is 0. This is the initial result set nameand can be changed by the owner of the result set. Set_Descriptiondescribes a result set, and, in certain implementations, the default isthe first few characters of the Query. Set_Description may be changed bythe owner. Created_Ts is the time at which the result set was created.Query contains the actual query which created this result set.

After the Buckets Definition table 300 and the Result Sets Table ofContents 400 are defined, the Result Sets Table of Contents may bepreloaded, result sets may be saved in a Bucket table, result sets maybe deleted, the number of buckets may be changed, and, the number of setids may be changed.

FIG. 5 illustrates a Bucket table 500 in accordance with certainimplementations of the invention. The Bucket table 500 has columns forSet_Id, Key, and Created_Ts. If there are “n” number of buckets inBuckets Definition table 300, then there are “n” Bucket tables 500.There may be a unique index on columns Set_Id, Key, and Created_Ts.Set_Id in a Bucket table is equal to Current_Set_Id in the Result SetsTable of Contents 400. Key is the unique key that identifies a record inthe system. Key is a unique value. Created_Ts is a timestamp which isequal to the timestamp for the result set in the Result Sets Table ofContents 400. There may be multiple rows with the same Set_Id and sameCreated_Ts, but each row will have a unique key value.

In FIGS. 6-9, an Input Structure table 600 describes an input structure(e.g., a queue) for result sets, a Deletion Structure table 700describes a deletion structure (e.g., a queue) for results sets, a DropBucket table 800 is used for dropping of a bucket table when the buckettable is no longer used, and a Statistics table 900 is used to determinean average number of records that may be deleted in an hour by a singleprocess.

FIG. 6 illustrates an Input Structure table 600 in accordance withcertain implementations of the invention. The Input Structure table 600has columns for Set_Id, Bucket_Table, Created_Ts, and Status. The InputStructure table 600 has a row for each set id and is used to put datafrom a result set into a bucket table. The Set_Id in the Input Structureis equal to the Set_Id in the Result Sets Table of Contents 400initially. Bucket_Table corresponds to the Bucket_Table in theResult_Sets Table of Contents 400 initially. The Created_Ts is equal tothe Created_Ts in the Result Sets Table of Contents 400 initially.Status is a first value (e.g., −1) or a second value (e.g., 1), wherethe first value (e.g., −1) indicates the insertion of the result sets ina Bucket table has not begun and the second value (e.g., 1) indicatesthat the insertion is in progress. There may be a unique indexconsisting of Set_Id and Created_Ts.

FIG. 7 illustrates a Deletion Structure table 700 in accordance withcertain implementations of the invention. The Deletion Structure table700 has columns for Set_Id, Bucket_Table, Created_Ts, and Set_Count.Set_Id contains the Current_Set_Id from the Result Sets Table ofContents 400. The Deletion Structure table 700 has a row for each set idand is used to remove data of a result set from a bucket table. Set_Ididentifies the result set. Bucket_Table contains theCurrent_Bucket_Table from the Result Sets Table of Contents 400.Created_Ts contains the timestamp for the given Current_Set_Id from theResult Sets Table of Contents 400. Set_Count contains the number ofrecords this result set contains. There may be an index on Set_Id andCreated_Ts.

FIG. 8 illustrates a Drop Bucket table 800 in accordance with certainimplementations of the invention. The Drop Bucket table 800 includes acolumn for Bucket_Table. There may be a unique index on Bucket_Table.The Drop Bucket table 800 represents the table to be dropped if thenumber of buckets are decreased. Once a bucket table is empty and islisted in the Drop Bucket table 800, then the bucket table will bedropped.

FIG. 9 illustrates a Statistics table 900 in accordance with certainimplementations of the invention. The Statistics table 900 includescolumns for Timestamp_begin, Timestamp_end, Timestamp_Interval,Number_of_Records_Deleted, Number_of_Processes_Involved, andAverage_Number_of_Records_Deleted. From the statistics, the deleteresult set component 140 determines how many processes are needed todelete a set of records within a given time interval. Additionally, thestatistics may be used to determine how many records may be deleted atone time. The Statistics table is cleaned up based upon aninitialization parameter that indicates how many days of informationshould be retained in the Statistics table, and the delete result setcomponent 140 takes care of this. Timestamp_begin and Timestamp_end aretimestamps that are recorded by the delete result set component 140after performing deletion processing. Timestamp_interval isTimestamp_end−Timestamp_begin. Additionally, Number_of_Records_Deleted,Number_of_Processes_Involved and Average_Number_of_Records_Deleted arenumeric fields.

FIG. 10 illustrates logic implemented in the pre-load/non-initializationcomponent 134 for preload initialization in accordance with certainimplementations of the invention. In block 1010, thepre-load/non-initialization component 134 determines whether the NextSet Id table 200 is empty and the Number_of_Buckets in the BucketsDefinition table 300 has not been set. If so, processing continues toblock 1012, otherwise, processing continues to block 1014. In block1012, the pre-load/non-initialization component 134 initializes the NextSet Id table 200, the Buckets Definition table 300, and the Result SetsTable of Contents 400, and the pre-load/non-initialization component 134creates the Bucket Tables 500. In block 1014, non-initializationprocessing is performed. That is, initially, the Bucket_Prefix in theBuckets Definition table 300 is set. Then, the Next Set Id table 200,the Buckets Definition table 300, and the Result Sets Table of Contents400 are loaded. In certain implementations, a system administrator mayspecify the data to be loaded into the tables 200, 300, and 400 (e.g.,Number_of_Set_Ids, Number_of_Buckets, etc.). In certain alternativeimplementations, the data to be loaded into the tables 200, 300, and 400may be predetermined defaults.

In certain implementations of the invention, the preload initializationlogic of FIG. 10 is performed in standalone mode for a data store 170.In certain alternative implementations of the invention, the preloadinitialization logic of FIG. 10 is performed while the server computer120 is performing other processing. To preload the Next Set Id table200, the Buckets Definition table 300, and the Result Sets Table ofContents 400, the maximum number of result sets and the total number ofbuckets is specified by, for example, a system administrator or setbased on a predetermined default value. If the Next Set Id table 200 isempty and the Number_of_Buckets in the Buckets Definition table 300 isnot set, then the Bucket tables 500 are created with the layout in FIG.5, and the Result Sets Table of Contents 400 is filled.

If a DropBuckets file and a CreateBuckets file (that would have beencreated by a previous run of the result set manager 132) exists, thenthe DropBuckets file is executed to drop all the bucket tablesidentified in the file, and the Result Sets Table of Contents table 400is dropped and recreated. This may happen if a previous preloadinitialization failed. Otherwise, the DropBuckets file and theCreateBuckets file are created, and then the CreateBuckets file isexecuted to create the Bucket tables 500. In certain implementations,the names of the Bucket tables 500 are formed by the Bucket_Prefixconcatenated with the bucket number. In certain implementations, thebucket number may be between 0 and Number_of_Buckets−1, whereNumber_of_Buckets is greater than or equal to 1, and theNumber_of_Set_Ids is greater than or equal to 1.

Once this is completed, the Result Sets Table of Contents table 400 iscreated and initialized. The Set_Id and Current_Set_Id are set to be thesame number. The Bucket_table and Current_Bucket_table are set to be thesame string. Every Set_Id between 0 and Number_of_Set_Ids−1 is insertedinto the table. The Bucket table which a given Set_Id belongs to isdetermined by looking at the remainder from the Set_Id divided by theNumber_of_Buckets. This determines which bucket table is recorded intoBucket_table and Current_Bucket_table. The name of the Bucket table isthe Bucket_Prefix concatenated with the modulo remainder of the divisionof the Set_Id by the Number_of_Buckets. Owned_By may be defaulted to asystem identifier such as admin. Set_Name may be defaulted to PRELOADconcatenated with Set_Id. Set_Description may be set equal to PRELOAD.Query may be set to a default query. Created_Ts may be set equal to thecurrent timestamp. Set_Count may be set equal to 0, andSaved_Complete_Flag may be set to the first value (e.g., 1).

The Next Set Id table is created with one row containing the value 0 forNext_Set_Id, and the maximum number of results sets forNumber_of_Set_Ids. The Buckets Definition table 300 is updated with thetotal number of buckets being placed in the Number_of_Buckets column forthe Bucket_Prefix. Once this is completed, then the DropBuckets andCreateBuckets files are deleted.

FIGS. 11A, 11B, and 11C illustrate logic implemented in thepre-load/non-initialization component 134 to perform non-initializationprocessing in accordance with certain implementations of the invention.In certain implementations of the invention, the non-initializationlogic of FIGS. 11A, 11B, and 11C is run in standalone mode. In certainalternative implementations of the invention, the non-initializationlogic of FIGS. 11A, 11B, and 11C is performed while the server computer120 is performing other processing. The non-initialization processingsets up various tables and cleans up one or more temporary files, named“before files”.

The non-initialization processing may be performed when theNumber_of_Set_Ids is changed and/or the Number_of_Buckets is changed byimplementations of the invention or by a system administrator. Beforeany changes to the tables 200, 300, and 400 are made, control begins atblock 1110, with the pre-load/non-initialization component 134determining whether one or more before files exist. If so, processingcontinues to block 1112, otherwise, processing continues to block 1116.That is, if one or more before files exist, then the non-initializationprocessing was invoked previously (“before”), and there are a set offiles (i.e., “before files”) that represent the backup of the tables200, 300, 400, 600, 700, and 800. In block 1112, the tables 200, 300,400, 600, 700, and 800 are restored from the backup before files using,for example, a data store utility to reload the tables 200, 300, 400,600, 700, and 800 with the original data to restore the previous state.Then, specific cases may be processed (block 1114).

If one or more before files did not exist, then, in block 1116, beforefiles are created. In particular, the tables 200, 300, 400, 600, 700,and 800 are unloaded to files whose names start with “before” followedby the table name (block 1120).

In block 1118, the pre-load/non-initialization component 134 determineswhether the before files were created successfully. If so, processingcontinues to block 1114. That is, once the before files are successfullycreated, a before file (e.g., “beforeresults1”) is created to indicatethe unload of tables 200, 300, 400, 600, 700, and 800 completedsuccessfully. At this point, specific cases may be processed (block1114). If the unload of the tables 200, 300, 400, 600, 700, and 800fails, then the processing exits with a message indicating what has tobe done to have successful creation of the before files that were notcreated successfully are deleted.

Also, when the Number_of_Set_Ids is increased or decreased, which bucketa Set_Id goes into is based upon modulo arithmetic, where the remainderof the division of the Set_Id by the Number_of_Buckets determines whichBucket_table said Set_Id belongs to. This is applicable to several ofthe cases discussed below.

In FIGS. 11B and 11C, specific cases are processed. In block 1150, thepre-load/non-initialization component 134 determines whether theNumber_of_Set_Ids has increased and the Number_of_Buckets remainsunchanged. If so, processing continues to block 1152, otherwise,processing continues to block 1154. In block 1152, processing for case 1is performed. Suppose the Number_of_Set_Ids is increased and theNumber_of_Buckets did not change, then additional rows are inserted intothe Result Sets Table of Contents 400, and the Number_of_Set_Ids in theNext Set Id table 200 is updated to the new number of set ids.

If the number of inserts into the Result Sets Table of Contents table400 is beyond the number of rows that can be handled in one unit of work(e.g., a number of transactions to be performed to complete certainprocessing, such as inserting a specified number of rows), then thenumber of inserts is broken into multiple units of work, and commits aredone after each unit of work. In certain implementations, the number ofrows that can be handled in one unit of work is specified by a parameterin a properties file that controls how many inserts may be performed inone unit of work. In certain implementations, the number of transactionsto be within one unit of work may be limited by the number oftransactions a log file can record. After the tables 200 and 400 havebeen updated, the before files are deleted, which indicates thatnon-initialization processing has been completed for case 1.

In block 1154, the pre-load/non-initialization component 134 determineswhether the Number_of_Set_Ids has decreased and the Number_of_Bucketsremains unchanged. If so, processing continues to block 1156, otherwise,processing continues to block 1158. In block 1156, processing for case 2is performed. The Set_Id and Bucket_Table in the Input Structure table600 are mapped with the Current_Set_Id and Current_Bucket_Table in theResult Sets Table of Contents table 400. Suppose the Number_of_Set_Idsis decreased and the Number_of_Buckets did not change, then rows aredeleted from the Result Sets Table of Contents table 400. The rows thatare deleted from the Result Sets Table of Contents table 400 are addedto the Deletion Structure table 700. Also, if the Set_Id of a deletedrow is in the Input Structure table 600 for the same Bucket_Table andCreated_Ts, then the row with that Set_Id is deleted from the InputStructure table 600.

In particular, in case 2, in which the Number_of_Set_Ids has decreased,the most current Number_of_Set_Ids remains in the Result Sets Table ofContents table 400. The Next_Set_Id is obtained from the Next Set Idtable 200 and compared with the new Number_of_Set_Ids (before this newvalue is updated in the Next Set Id table 200), which will be themaximum number of Set Ids.

When the Next_Set_Id is compared with the new Number_of_Set_Ids, if theNext_Set_Id is equal to the new Number_of_Set_Ids, then all the rowshaving Set_Ids from the Next_Set_Id to the old Number_of_Set_Ids−1 aredeleted from the Result Sets Table of Contents table 400, and rows whoseCurrent_Set_Id is equal to the Set_Id of a deleted row are also deletedfrom the Input Structure table 600. The Set_Ids are added to theDeletion Structure table 700. The Next Set Id table 200 is updated bysetting the Next_Set_Id to 0 and changing the Number_of_Set_Ids to thenew Number_of_Set_Ids. Tables 400, 600, and 700 are changed for the samerow in the same unit of work (i.e., with the same Set_Ids). If there aremore rows than can be handled in one unit of work, then there may bemore than one commit that is issued.

When the Next_Set_Id is compared with the new Number_of_Set_Ids, if theNext_Set_Id is less than the new Number_of_Set_Ids, then the Set_Idswhich remain in the Next Set Id table 200 are 0 to Next_Set_Id−1, plusthe old Number_of_Set_Ids−(new Number_of_Set_Ids−Next_Set_Id) to oldNumber_of_Set_Ids−1. The old Number_of_Set_Ids−(newNumber_of_Set_Ids−Next_Set_Id) is given the value of Next_Set_Id, andthe old Number_of_Set_Ids−1 is given the value of newNumber_of_Set_Ids−1. For the Set_Ids that have changed, these Set_Idsare updated and the Bucket_Table column of the Result Sets Table ofContents table 400 is updated for these Set_Ids. The Set_Ids that aredeleted from the Result Sets Table of Contents table 400 are moved tothe Deletion Structure table 700, and these Set_Ids are removed from theInput Structure table 600. The Deletion Structure table 700 and InputStructure table 600 work off of the Current_Set_Id and theCurrent_Bucket_Table. After this has been done, the Number_of_Set_Ids inthe Next Set Id table 200 is updated with the new Number_of_Set_Ids.

When the Next_Set_Id is compared with the new Number_of_Set_Ids, if theNext_Set_Id is greater than the new Number_of_Set_Ids, then the Set_Idsremaining in the Result Sets Table of Contents table 400 is determinedas follows. The Set_Ids that remain are from Next_Set_Ids−newNumber_of_Set_Ids to Next_Set_Ids−1. The remaining Set Ids values aremapped from 0 to new Number_of_Set_Ids−1, with their correspondingBucket_Table value being recalculated based upon the modulo arithmeticthat has already been described. The Set_Ids that are deleted from theResult Sets Table of Contents table 400 are placed in the DeletionStructure table 700 and are removed from the Input Structure table 600.The rows in these three tables 400, 600, and 700 are acted upon in aunit of work. If there are too many rows involved for one unit of work,then there may be more than one commit issued. After this has been done,then the Next_Set_Id is changed to 0, and the Number_of_Set_Ids in theNext Set Id table 200 is updated with the new Number_Of_Set_Ids.

In block 1158, the pre-load/non-initialization component 134 determineswhether the Number_of_Buckets has decreased and the Number_of_Set_Idsremains unchanged. If so, processing continues to block 1160, otherwise,processing continues to block 1162. In block 1160, processing for case 3is performed. That is, if the Number_of_Buckets is being decreased(based upon processing by implementations of the invention or due toactions by a system administrator) in the Buckets Definition table 300,then the Bucket_table column in the Result Sets Table of Contents table400 is recalculated for each Set_Id, using the modulo arithmetic whichhas been described before. The Bucket tables that are to be deleted areadded to the Drop Bucket table 800, and these bucket tables are droppedwhen there is no data in them. After this has been completed, theNumber_of_Buckets in the Buckets table 300 is updated with the newNumber_of_Buckets.

In block 1162, the pre-load/non-initialization component 134 determineswhether the Number_of_Buckets has increased and the Number_of_Set_Idsremains unchanged. If so, processing continues to block 1164, otherwise,processing continues to block 1166. In block 1164, processing for case 4is performed. In particular, if the Number_of_Buckets is being increased(based upon processing by implementations of the invention or due toactions by a system administrator) in the Buckets table 300, then theBucket_table column in the Result Sets Table of Contents table 400 isrecalculated for each Set_Id using the modulo arithmetic which has beendescribed before. Before creating a new bucket table, thepre-load/non-initialization component 134 determines whether the Buckettable is listed in the Drop Bucket table 800. If so, then the buckettable is deleted from the Drop Bucket table 800, and the bucket table isnot created, as the bucket table already exists as a Bucket table.Otherwise, the new bucket table is created (with the Bucket prefix andan updated Bucket_Table value). For example, if Number_of_Bucketsincreases from 5 to 7, then, two new Bucket tables are created, such as“Bucket6” and “Bucket7”. After this has been completed, then theNumber_of_Buckets in the Buckets Definition table 300 is updated withthe new Number_of_Buckets.

In block 1166, the pre-load/non-initialization component 134 determineswhether the Number_of_Set_Ids has increased and the Number_of_Bucketshas decreased. If so, processing continues to block 1168, otherwise,processing continues to block 1170. In block 1168, processing for case 5is performed. Suppose Number_of_Set_Ids is being increased and theNumber_of_Buckets is being decreased, then, the processing of case 3 isapplied to the already existing Set_Ids, and then, the processing ofcase 1 is applied to these Set_Ids, using the new Number_of_Buckets todetermine which Bucket table a Set_Id belongs to.

In block 1170, the pre-load/non-initialization component 134 determineswhether the Number_of_Set_Ids has increased and the Number_of_Bucketshas increased. If so, processing continues to block 1172, otherwise,processing continues to block 1174. In block 1172, processing for case 6is performed. Suppose Number_of_Set_Ids is being increased and theNumber_of_Buckets is being increased. Then, the processing of case 4 isapplied to the already existing Set_Ids, and then the processing of case1 is applied to these Set_Ids, using the new Number_of_Buckets todetermine which Bucket table a Set_Id belongs to.

In block 1174, the pre-load/non-initialization component 134 determineswhether the Number_of_Set_Ids has decreased and the Number_of_Bucketshas decreased. If so, processing continues to block 1176, otherwise,processing continues to block 1178. In block 1176, processing for case 7is performed. Suppose Number_of_Set_Ids is being decreased and theNumber_of_Buckets is being decreased. The processing of case 2 isapplied to the existing Set_Ids, and then, the processing of case 3 isapplied to these Set_Ids.

In block 1178, the pre-load/non-initialization component 134 determineswhether the Number_of_Set_Ids has decreased and the Number_of_Bucketshas increased. If so, processing continues to block 1180, otherwise,processing continues to block 1182. In block 1180, processing for case 8is performed. Suppose Number_of_Set_Ids is being decreased and theNumber_of_Buckets is being increased. The processing of case 2 isapplied to the existing Set_Ids, and then, the processing of case 4 isapplied to these Set_Ids.

In block 1182, the Next Set Id table 200 and the Buckets Definitiontable 300 are updated, and the before files are deleted, if thisprocessing has not already been performed by the specific caseprocessing (blocks 1152, 1156, 1160, 1164, 1168, 1172, 1176, or 1180).

FIG. 12 illustrates logic implemented in the master component 136 forserver initialization in accordance with certain implementations of theinvention. This logic describes server operations to manage result sets.The initialization parameters for the server computer 120 consist of amaximum number of connections to use for insertion, a maximum number ofconnections to use for deletion, a number of connections for otherprocesses (at most 4 in certain implementations), a maximum number ofrows that can be inserted in one unit of work, a maximum number of rowsthat can be deleted in one unit of work, a maximum number of rows thatcan be updated in one unit of work, when deletions and drop tables areto be done, and how many days of statistics are to be maintained. Theuserids and encrypted passwords of the server computer 120 running undera user are also contained in the initialization parameters forconnecting to the data store 170, in addition to the data store name.The server computer 120 supplies userids and passwords to access thedata store 170.

Control begins at block 1210 with the master component 136 starting upwhen the server computer 120 starts. In block 1212, the master component136 sets a status to a first value (e.g., −1) in the Input Structuretable 600 for each row to identify rows that are to be worked on fromthe beginning (e.g., start processing these rows understanding that noprocessing was previously performed on these rows). The master component136 updates the status by performing an update based upon the positionof a cursor and moves to the next row in a loop. If the number of rowsexceeds the maximum number of rows that can be updated, then a commit isperformed. The master component 136 continues initializing the InputStructure table 600 until all rows that do not have a status of a firstvalue (e.g., −1) are set to the first value (e.g., −1).

In block 1214, the master component 136 receives new requests, obtains aNext_Set_Id, and updates the Result Sets Table of Contents table 400,the Input Structure table 600, and the Deletion Structure table 700. Inparticular, the server computer 120 consists of a master component 136that receives queries for which a result set is created. The query maybe transmitted in, for example, two forms. One form is in a format thatis entered by a user and that describes how the initial query wasentered (e.g., this initial query may be transformed to a query that canbe executed), and the other form is the actual query that is run toproduce the result.

For example, the master component 136 receives a new request andretrieves the Next_Set_Id from the Next Set Id table 200 and uses thisas the Set_Id that is placed in the Result Sets Table of Contents table400. Before placing the Next_Set_Id back into the Next Set Id table 200,the master component 136 increments the Next_Set_Id by 1 and comparesthis incremented Next_Set_Id to the Number_of_Set_Ids in the Next Set Idtable 200. If the incremented Next_Set_Id is less than theNumber_of_Set_Ids, then the master component 136 updates the Next_Set_Idin the Next Set Id table 200 with this new value. Otherwise, theNext_Set_Id is set to 0 in the Next Set Id table 200.

Also, the Number_of_Buckets and Bucket_Prefix are retrieved at thestartup of the master component 136 from the Buckets Definition table300. Using modulo arithmetic, the master component 136 determines theBucket table into which the result set will be stored. The actual buckettable is the Bucket_Prefix concatenated with the remainder of the Set_Iddivided by the Number_of_Buckets. Before placing the information intothe Result Sets Table of Contents table 400 for the new Set_Id (i.e.,the retrieved Next_Set_Id), current information is retrieved for Set_Id(which is the value of Current_Set_Id), current information is retrievedfor Bucket_Table (which is the value of Current_Bucket_Table),Created_Ts, and Set_Count, and this data is placed in the DeletionStructure table 700.

After this, information is placed into a row of the Result Sets Table ofContents table 400 for the new Set_Id. The Set_Id and the Current_Set_Idare set equal to the new Set_Id. The Bucket_Table andCurrent_Bucket_Table are set equal to the new Bucket_Table (which hasbeen calculated). Owned_By is set to the user who is creating thisresult set. Set_Name is set to S concatenated with the Set_Id.Set_Description is set to the first few characters of the query.Created_Ts is set to the Current Timestamp. The Query stores the query(e.g., a query Extensible Markup Language (XML) object). Set_Count isset to 0, and the Saved_Complete_Flag is set to the second value (e.g.,0).

A row is inserted into the Input Structure table 600 with the Set_Id,Bucket_Table and Created_Ts that have been updated in the Result SetsTable of Contents table 400, and the Status is set to a first value(e.g., −1). Obtaining the Set_Id and storing the next Set_Id back in theNext Set Id table 200 may be done as an atomic operation with anexclusive lock being held until this has completed successfully. Theother tables may be changed in a single unit of work.

In block 1216, the master component 136 starts up the insert result setcomponent 138. In block 1218, the master component 136 starts up thedelete result set component 140. In block 1220, the master component 136starts up the drop table component 142. The processing of blocks 1214,1216, 1218, and 1220 may be performed by the master component 134concurrently.

FIGS. 13A, 13B, and 13C illustrates logic implemented in the insertresult set component 138 and in insertion processes spawned by theinsert result set component 138 in accordance with certainimplementations of the invention. The insert result set component 138sets up the insertion connection pool by using the maximum number ofconnections to use for insertion. In block 1310, the insert result setcomponent 138 reads the Input Structure table 600 for information onwhich insertion processes are to be started to perform insertions andstarts and/or stops insertion processes to handle insertion requests.For example, if there are 10 insertion requests, then 10 insertionprocesses may be started. If there are more insertion requests thanthere are connections, then these additional insertion requests remainto be handled by the insertion processes. An insertion process isstarted by the insert result set component 138 to handle one insertionrequest. Once an insertion process completes, then the insert result setcomponent 138 will either end the insertion process if no otherinsertion requests remain to be handled and return the connection to aconnection pool for this insertion process or the insert result setcomponent 138 will give the insertion process another insertion requestto handle. The insertion result set component 138 continues to startand/or stop insertion processes until termination (e.g., when the resultset manager 132 is terminated).

In block 1312, a started insertion process first changes the Status to asecond value (e.g., 1) in the Input Structure table 600 for theinsertion request it is working on based upon the Set_Id, Bucket_Table,and Created_Ts of the insertion request. Then, (block 1314) theinsertion process attempts to obtain the actual query to run from theResult Sets Table of Contents table 400. In block 1316, the insertionprocess determines whether a query is present in the Result Sets Tableof Contents table 400 for which the Current_Set_Id is equal to theSet_Id of the insertion request, the Current_Bucket_Table is equal toBucket_Table of the insertion request, and the Created_Ts is equal tothe Created_Ts of the insertion request. If so, processing continues toblock 1318, otherwise, processing continues to block 1326. In block1326, since no row was found, then the row corresponding to theinsertion request is placed on the Deletion Structure table 700 andremoved from the Input Structure table 600. After this is done, theinsertion process informs the insert result set component it hascompleted the insertion request, and the insert result set component 138either ends the insertion process or gives the insertion process anotherrequest to handle.

In block 1318, the insertion process starts or continues insertion intoa bucket table and, after each commit, updates Set_Count in the ResultSets Table of Contents table 400 for the result set. The insertionprocess may break up a unit of work into multiple units of work, performa commit after one unit of work, then “continues” with another unit ofwork. After the Query column is retrieved from the Result Sets Table ofContents table 400, then the insertion process pulls the actual query tobe executed from the Query that was returned and retrieves the Keyvalues that are to be inserted into the Bucket_Table for the Set_Id andCreated_Ts for the insertion request in the Input Structure table 600.

Before performing any insertions, the insertion process determineswhether any data is in the Bucket table 500 for this insertion request.If there is, then the insertion process deletes this information.Additionally, before performing any insertion, the insertion processalso determines how many rows are to be inserted. If the number of rowsto be inserted are less than or equal to the maximum number of rows thatcan be inserted in one unit of work, then a single insert is performedusing, for example, an insert select construct followed by a commit ifthe select statement used in the insert is not using Common TableExpression (CTE) format. A CTE format is one way of structuring a query.If the single insert fails, then a rollback is performed and the valuesmay be inserted by using a block of inserts. Otherwise, the inserts maybe constructed in a loop by using a set of key values in a selectstatement for the single insert based upon retrieving the number of keyvalues from the first select and moving these onto an insert selectconstruct followed by a commit in the loop. The commit point for theinsert is based upon the maximum number of rows to be inserted or, ifthe number of rows to be inserted is less than the maximum, then thecommit is performed.

If a block insert fails, then a rollback is performed, the Set_Count isset back to 0, any data in the Bucket Table 500 for this result set isremoved, and the data is then obtained by going back to the firstposition of the select, since the cursor is scrollable and retrieves atmost 100 values at a time, which are then used to create an insertselect statement. A commit is performed after each of these inserts. Ifthis should fail, then this is noted in a log so that it may beprocessed later (e.g., by a system administrator). In the loop, theResult Sets Table of Contents table 400 is updated for the Set_Countcolumn for the given Current_Set_Id, Current_Bucket_Table andCreated_Ts.

In block 1320, the insertion process determines whether it is done. Ifso, processing continues to block 1322, otherwise, processing continuesto block 1324. In block 1322, the insertion request is removed from theInput Structure table 600. Also, when the insertion operation hascompleted, the Saved_Complete_Flag is set to the first value (e.g., 1)by the insertion process. When an insertion request is moved from theInput Structure table 600 to the Deletion Structure table 700, thenumber of rows that have been inserted for this request into a Buckettable 500 is obtained and placed in a row that is placed in the DeletionStructure table 700. If the row already exists in the Deletion Structuretable 700, then the insertion request is removed from the InputStructure table 600 and not placed in the Deletion Structure table 700.

In block 1324, the insertion process determines whether the insertionrequest is still in the Result Sets Table of Contents table 400. If so,processing returns to block 1318. Otherwise, if the insertion request isnot found in the Result Sets Table of Contents table 400, then theinsertion process moves the insertion request to the Deletion Structuretable 700, removes the insertion request from the Input Structure table600, and informs the insert result set component 138 that it hascompleted the insertion request. The Set_Count is updated in the ResultSets Table of Contents table 400 with the count of how many rows belongto this result set.

Upon receiving a notification from an insertion process, the insertresult set component 138 goes back to read the Input Structure table 600to determine whether there are more insertion requests to handle and, ifthere are more insertion requests to handle, gives out an insertionrequest to the insertion process.

FIGS. 14A and 14B illustrate logic implemented in a delete result setcomponent 140 and in deletion processes spawned by the delete result setcomponent 140 in accordance with certain implementations of theinvention. In block 1410, the delete result set component 140 determineswhether it is ready to start. If so, processing continues to block 1412,otherwise, processing continues to block 1422. In block 1422, the deleteresult set component 140 sleeps till it is ready to start. In certainimplementations, the delete result set component 140 sleeps until it hasto start working based upon one or more parameter(s) that indicate whenthe delete result set component 140 should run.

The delete result set component 140 reads deletion requests from theDeletion Structure table 700 to determine which result sets are to bedeleted and starts and/or stops deletion processes to handle deletionrequests until the Deletion Structure table 700 has been read completelyor the end of the interval of time for deletions is reached. The deleteresult set component 140 reads the Statistics table 900 to figure outhow many deletion processes should be started to handle the deletionrequests based upon how many rows need to be deleted. The delete resultset component 140 also records statistics in Statistics table 900 basedupon how deletions are completed by deletion processes once the deleteresult set component 140 has collected the information for an intervalof time. This allows the delete result set component 140 to dynamicallydetermine how many processes should be started up, with the restrictionbeing the maximum number of connections available for deletion. Thedelete result set component creates a connection pool for this purposeand keeps track of how many connections are in use at any time tobalance the deletion process during the time interval for deletion.

In block 1412, the delete result set component 140 reads a deletionrequest and, if a deletion request exists, a deletion process isassigned to handle the deletion request. The deletion process that isassigned may be newly started by the delete result set component 140 ormay be a deletion process that has completed processing another deletionrequest. In block 1412, if a deletion request does not exist, the deleteresult set component 140 may terminate extra deletion processes that donot have deletion requests to process.

In block 1414, if there are more deletion requests to process from theDeletion Structure table 700, processing continues to block 1418,otherwise, processing continues to block 1416. In block 1418, if timeremains for processing deletion requests in the interval, processingcontinues to block 1412, otherwise, processing continues to block 1422.In block 1416, if there is more time in the interval, processingcontinues to block 1420, otherwise, processing continues to block 1422.In block 1420, the delete result set component 140 sleeps for a periodof time (e.g., one minute) and processing returns to block 1412 to startone or more deletion processes.

In block 1424, once a deletion process is started to perform thedeletion of a result set, the deletion process determines whether theresult set can be deleted. If so, processing continues to block 1426,otherwise, processing continues to block 1430. In block 1430, thedeletion process returns control to the delete result set component 140,and the deletion process may be assigned a new deletion request or maybe terminated. In particular, the deletion process determines whetherthe deletion request is in the Input Structure table 600. If thedeletion request is in the Input Structure table 600, then this deletionrequest is skipped, and the deletion process returns control to thedelete result set component 140, which either gives the next request tothis deletion process or terminates the deletion process when all otherdeletion requests are being handled by other deletion processes (block1412).

In block 1426, the deletion process deletes part or all of the resultset and commits. In particular, if the result set to be deleted is notin Input Structure table 600, then the deletion process goes to a Buckettable 500 to determine how many rows are in the Bucket table 500 for theresult set that is to be deleted. The deletion process determineswhether the delete can be done with a single delete based upon themaximum number of rows that can be deleted in a unit of work. If thedelete can be done with a single delete for the Set_Id and Created_Ts inthe given Bucket_Table, then a commit is done after this delete, andthis deletion request is removed from the Deletion Structure table 700.

Otherwise, a select is performed against a Bucket table 500 for thegiven Set_Id and Created_Ts. The Keys are retrieved in a loop. If thenumber of Keys is equal to the maximum number of rows that can bedeleted in one unit of work, then they are deleted with one delete usingthe key values to delete these rows, and then more Keys are retrievedfor the result set. If the end of data is reached and the number of keysretrieved is less than or equal to the maximum number of rows that canbe deleted in one unit of work, then they are deleted.

If the delete can not be done using the maximum number of rows, sincethe number of rows to be deleted is too large, then the delete is donein groups of at most 100 records at a time followed by a commit. If thisshould fail, then this is noted in a log so that it may be processedlater (e.g., by a system administrator).

In block 1428, after a commit, the deletion process determines whetherdeletion for the deletion request is finished. If so, processingcontinues to block 1430, otherwise, processing returns to block 1426.After all the requested rows of the result set are deleted, the deletionrequest is removed from the Deletion Structure table 700, and the deleteresult set component 140 is informed that the deletion has beencompleted.

At this point, the delete result set component 140 either terminatesthis deletion process or gives the deletion process another request ifthe delete result set component 140 determines that there are moredeletion requests to be processed in the deletion interval and thisdeletion process is needed to handle the operation based upon thestatistical information which is gathered and stored in the Statisticstable 900. The delete result set component 140 goes back to read theDeletion Structure table 700 to determine whether there are moredeletion requests to handle so that the delete result set component 140can calculate how many processes need to be used based upon thestatistics for the number of records to be deleted in a given timeinterval and the maximum number of processes which can be used from itsconnection pool.

FIGS. 15A and 15B illustrate logic implemented in the drop tablecomponent 142 in accordance with certain implementations of theinvention. In block 1510, the drop table component 142 determineswhether it is time to start processing. If so, processing continues toblock 1512, otherwise, processing continues to block 1524. In block1524, the drop table component 142 sleeps till ready. In certainimplementations, the drop table component 142 sleeps until it has tostart working based upon one or more parameter(s) that indicate when thedrop table component 142 should run.

In block 1512, the drop table component 142 reads the Drop Bucket table800 to determine which tables are to be dropped, one by one. In block1514, the drop table component 142 determines whether the end of tableis reached. If so, processing continues to block 1516, otherwise,processing continues to block 1520 to continue dropping tables. In block1516, the drop table component 142 determines whether there is time leftin the interval. If so, processing continues to block 1518, otherwise,processing continues to block 1524. In block 1518, the drop tablecomponent 142 sleeps for a period of time (e.g., one minute) andcontinues to block 1512. For example, the Drop Bucket table 800 may beempty, so the drop table component 142 sleeps during the interval, and,upon waking up, rechecks whether any rows have been added to the DropBucket table 800 for processing.

In block 1520, before dropping a table, the drop table component 142finds out whether the bucket table is empty by counting the number ofrows in the Bucket table 500 and finds out whether there are inserts tobe performed by the Input Structure table 600 by counting the number ofrows in the Input Structure table 600 that list the Bucket_Table whichis to be dropped. If both queries result in the value of 0, thenprocessing continues to block 1522, otherwise, processing continues toblock 1512. In block 1522, the table is dropped, and the row that saysto drop this table is removed from the Drop Bucket table 800.

In certain implementations, the drop table component 142 has oneconnection to the data store 170 and performs everything directlywithout any subprocesses. The drop table component 142 runs based uponwhen drop tables are to be performed.

In certain implementations of the invention, the Result Sets Table ofContents table 400 allows retrieval of the rows of a result set eitherby using a query if the result set is not completely built or by usingthe bucket table joined with other tables in the system using Key valuesas the join mechanism for visualizing the results. This is a mechanismfor looking at different points in time with content (e.g., rows)changing. Also, to see the content (e.g., rows) of a result set beforeit is completely built, a value in the system may be set to obtain thiscontent.

In particular, when the result of a query is saved in a bucket table,the result set is identified by a set id, a timestamp, and the uniquekeys of the records in the result set. Using the unique keys for a setid, it is possible to reconstitute a point in time result withoutreissuing the initial query that created the result. When the set id isreused, the previous result is placed in a deletion queue to be deleted.The query that created the result set is also saved so that the querycan be rerun to see what the result would look like at a later time thanthe original execution time of the query (e.g., against a database thathas potentially changed since the last time the query was executed). Forexample, in a library system a user may want to look at results that donot have data in them after a certain date, and the saved result setallows this. The saved result set decreases the search and operatingdomain.

For the following example, there is a result set with a Set_Id of “n” ina Bucket table “Rsm”. The result set with the Set_Id of “n” has aCreated_Ts of “yyyy-mm-dd-hh:mm:ss:ffffff”, and the data which formsthis result set is associated with table “Table1”, which has columns“a”, “b”, and “c”. The following sample query (1) provides point-in-timedata from Bucket table “Rsm”, without executing the original query thatcreated the result set having the Set_Id of “n”.

-   SELECT Rsm.Key,b,c Query (1)-   FROM Rsm, Table1-   WHERE Rsm.Created_Ts=‘yyyy-mm-dd-hh:mm:ss:ffffff’ and Rsm.Set_d=n    and Rsm.Key=Table1.a

Sample query (1) retrieves results that are based upon the result sethaving the Set_Id of “n” and does not introduce additional rows sincethe result set was created by executing the original query. Therefore,the results of query (1) may be missing some rows that may have beenadded to table “Table1” or some rows that were deleted from table“Table1” since the original query was run.

Sample query (2) retrieves all the rows in the result set including therows that have no values in the system any longer:

-   SELECT Rsm.Key,b,c Query (2)-   FROM Rsm left join Table1 on Rsm.Key=Table1.a-   WHERE Rsm.Created_Ts=‘yyyy-mm-dd-hh:mm:ss:ffffff’ and Rsm.Set_Id=n

Sample query (3) retrieves rows that have been added to Table1 since theresult set was created:

-   SELECT a.b,c Query (3)-   FROM Table1-   where Table1.a not exists (select * from Rsm where Rsm.Key=Table1.a    and Rsm.Created_Ts=‘yyyy-mm-dd-hh:mm:ss:ffffff’ and Rsm.Set_Id=n)

Sample queries (1), (2), and (3) represent just a few of the uses of asaved result set, and many other types of queries may be performed onthe saved result set.

Thus, implementations of the invention allow one to refine queriesagainst the result set and drill into information for further detailswithout going back to the starting point. When the number of result setsis changed and/or the number of bucket tables are changed there is nomovement of the result set content, and, therefore, processing isperformed via a mapping mechanism. Therefore, the retrieval ofinformation is quick.

Additional Implementation Details

The described techniques for result set management may be implemented asa method, apparatus or article of manufacture using standard programmingand/or engineering techniques to produce software, firmware, hardware,or any combination thereof. The term “article of manufacture” as usedherein refers to code or logic implemented in hardware logic (e.g., anintegrated circuit chip, Programmable Gate Array (PGA), ApplicationSpecific Integrated Circuit (ASIC), etc.) or a computer readable medium,such as magnetic storage medium (e.g., hard disk drives, floppy disks,tape, etc.), optical storage (CD-ROMs, optical disks, etc.), volatileand non-volatile memory devices (e.g., EEPROMs, ROMs, PROMs, RAMs,DRAMs, SRAMs, firmware, programmable logic, etc.). Code in the computerreadable medium is accessed and executed by a processor. The code inwhich preferred embodiments are implemented may further be accessiblethrough a transmission media or from a file server over a network. Insuch cases, the article of manufacture in which the code is implementedmay comprise a transmission media, such as a network transmission line,wireless transmission media, signals propagating through space, radiowaves, infrared signals, etc. Thus, the “article of manufacture” maycomprise the medium in which the code is embodied. Additionally, the“article of manufacture” may comprise a combination of hardware andsoftware components in which the code is embodied, processed, andexecuted. Of course, those skilled in the art will recognize that manymodifications may be made to this configuration without departing fromthe scope of the present invention, and that the article of manufacturemay comprise any information bearing medium known in the art.

The logic of FIGS. 10, 11A-C, 12, 13A-C, 14A-B, and 15A-B describesspecific operations occurring in a particular order. In alternativeimplementations, certain of the logic operations may be performed in adifferent order, modified or removed. Moreover, operations may be addedto the above described logic and still conform to the describedimplementations. Further, operations described herein may occursequentially or certain operations may be processed in parallel, oroperations described as performed by a single process may be performedby distributed processes.

The illustrated logic of FIGS. 10, 11A-C, 12, 13A-C, 14A-B, and 15A-Bmay be implemented in software, hardware, programmable andnon-programmable gate array logic or in some combination of hardware,software, or gate array logic.

FIG. 16 illustrates an architecture of a computer system that may beused in accordance with certain implementations of the invention.Computers 100 and/or 120 and/or 180 may implement computer architecture1600. The computer architecture 1600 may implement a processor 1602(e.g., a microprocessor), a memory 1604 (e.g., a volatile memorydevice), and storage 1610 (e.g., a non-volatile storage area, such asmagnetic disk drives, optical disk drives, a tape drive, etc.). Anoperating system 1605 may execute in memory 1604. The storage 1610 maycomprise an internal storage device or an attached or network accessiblestorage. Computer programs 1606 in storage 1610 may be loaded into thememory 1604 and executed by the processor 1602 in a manner known in theart. The architecture further includes a network card 1608 to enablecommunication with a network. An input device 1612 is used to provideuser input to the processor 1602, and may include a keyboard, mouse,pen-stylus, microphone, touch sensitive display screen, or any otheractivation or input mechanism known in the art. An output device 1614 iscapable of rendering information from the processor 1602, or othercomponent, such as a display monitor, printer, storage, etc. Thecomputer architecture 1600 of the computer systems may include fewercomponents than illustrated, additional components not illustratedherein, or some combination of the components illustrated and additionalcomponents.

The computer architecture 1600 may comprise any computing device knownin the art, such as a mainframe, server, personal computer, workstation,laptop, handheld computer, telephony device, network appliance,virtualization device, storage controller, etc. Any processor 1602 andoperating system 1605 known in the art may be used.

The foregoing description of implementations of the invention has beenpresented for the purposes of illustration and description. It is notintended to be exhaustive or to limit the invention to the precise formdisclosed. Many modifications and variations are possible in light ofthe above teaching. It is intended that the scope of the invention belimited not by this detailed description, but rather by the claimsappended hereto. The above specification, examples and data provide acomplete description of the manufacture and use of the composition ofthe invention. Since many implementations of the invention can be madewithout departing from the spirit and scope of the invention, theinvention resides in the claims hereinafter appended.

1. A system for result set management, comprising: a processor; meansfor receiving input from a system administrator of a number of resultsets that are to be stored and a number of bucket tables that are tohold the result sets, wherein the number of result sets represents howmany result sets are to be stored, and wherein the number of buckettables represents how many bucket tables are to be stored in a database;means for initializing a result sets table of contents that includes arow for each existing result set, a bucket table column, and a setidentifier that identifies a result set, wherein the bucket table columnidentifies a bucket table in which a result set is stored, wherein theresult sets table of contents comprises a table in the database that isseparate from the bucket tables; means for storing one or more resultsets in the bucket tables, wherein each result set was generated byexecuting a query; means for receiving input from the systemadministrator indicating changes to the number of result sets that areto be stored in the bucket tables and changes to the number of buckettables that are to be stored in the database; and means for, in responseto receiving the input from the system administrator indicating thechanges, means for, in response to determining that the input receivedfrom the system administrator indicates that the number of result setshas increased and the number of bucket tables has decreased,recalculating values in the bucket table column of the result sets tableof contents for existing set identifiers to determine which bucket tableis to store which result set and to determine one or more bucket tablesto be dropped, dropping one or more empty bucket tables, and insertingadditional rows into the result sets table of contents for the increasednumber of result sets; and means for, in response to determining thatthe input received from the system administrator indicates that thenumber of result sets has decreased and the number of bucket tables hasincreased, deleting rows in the result sets table of contents forexisting set identifiers, recalculating values in the bucket tablecolumn of the result sets table of contents for remaining setidentifiers to determine which bucket table is to store which resultset, and creating one or more bucket tables.
 2. The system of claim 1,further comprising: means for receiving input from the systemadministrator indicating that the number of result sets has increasedand that the number of bucket tables is unchanged; and means for, inresponse to determining that the input received from the systemadministrator indicates that the number of result sets has increased andthe number of bucket tables is unchanged, inserting rows into the resultsets table of contents to enable storage of additional result sets. 3.The system of claim 1, further comprising: means for receiving inputfrom the system administrator indicating that the number of result setshas decreased and that the number of bucket tables is unchanged; andmeans for, in response to determining that the input received from thesystem administrator indicates that the number of result sets that maybe stored is decreased and the number of bucket tables is unchanged,deleting rows in the result sets table of contents.
 4. The system ofclaim 1, further comprising: means for receiving input from the systemadministrator indicating that the number of result sets is unchanged andthat the number of bucket tables is changed; and means for, in responseto determining that the input received from the system administratorindicates that the number of result sets is unchanged and the number ofbucket tables has changed, recalculating values in the bucket tablecolumn of the result sets table of contents by determining which buckettable is to hold each of the one or more result sets based on a setidentifier associated with each result set modulo the number of bucketsthat may hold result sets.
 5. The system of claim 1, further comprising:means for receiving input from the system administrator indicating thatthe number of result sets has decreased and that the number of buckettables has decreased; and means for, in response to determining that theinput received from the system administrator indicates that the numberof result sets has decreased and the number of bucket tables hasdecreased, deleting rows in the result sets table of contents forexisting set identifiers, recalculating values in the bucket tablecolumn of the result sets table of contents for remaining setidentifiers, dropping one or more bucket tables, and removing resultsets contained in the dropped bucket tables.
 6. The system of claim 1,further comprising: means for receiving input from the systemadministrator indicating that the number of result sets has increasedand that the number of bucket tables has increased; and means for, inresponse to determining that the input received from the systemadministrator indicates that the number of result sets has increased andthe number of bucket tables has increased, recalculating values in thebucket table column of the result sets table of contents for existingset identifiers, creating one or more bucket tables, and insertingadditional rows into the result sets table of contents.
 7. The system ofclaim 1, further comprising: means for receiving a request for a resultset holding content at a point in time; and means for returning theresult set without re-executing a query from which the result set wasgenerated.
 8. The system of claim 1, further comprising: means forreceiving a request to execute a query that has been stored for one ofthe result sets that has been stored; and means for executing the queryto generate a new result set.
 9. The system of claim 1, wherein theresult set management is performed at one of a data store engine, a webapplication server that communicates with the data store engine, and onseparate multiple servers.
 10. The system of claim 1, wherein the resultsets may be stored in one or more data stores at one or more servercomputers.
 11. The system of claim 1, further comprising: means for,when at least one of the number of result sets that may be stored andthe number of bucket tables that may hold result sets is modified,mapping existing result sets to set identifiers and bucket tables basedon the modification, without moving contents of the existing resultsets.
 12. An article of manufacture comprising a computer readablemedium including a program for result set management, wherein theprogram causes operations to be performed, the operations comprising:receiving input from a system administrator of a number of result setsthat are to be stored and a number of bucket tables that are to hold theresult sets, wherein the number of result sets represents how manyresult sets are to be stored, and wherein the number of bucket tablesrepresents how many bucket tables are to be stored in a database;initializing a result sets table of contents that includes a row foreach existing result set, a bucket table column, and a set identifierthat identifies a result set, wherein the bucket table column identifiesa bucket table in which a result set is stored, wherein the result setstable of contents comprises a table in the database that is separatefrom the bucket tables; storing one or more result sets in the buckettables, wherein each result set was generated by executing a query;receiving input from the system administrator indicating changes to thenumber of result sets that are to be stored in the bucket tables andchanges to the number of bucket tables that are to be stored in thedatabase; and in response to receiving the input from the systemadministrator indicating the changes, in response to determining thatthe input received from the system administrator indicates that thenumber of result sets has increased and the number of bucket tables hasdecreased, recalculating values in the bucket table column of the resultsets table of contents for existing set identifiers to determine whichbucket table is to store which result set and to determine one or morebucket tables to be dropped, dropping one or more empty bucket tables,and inserting additional rows into the result sets table of contents forthe increased number of result sets; and in response to determining thatthe input received from the system administrator indicates that thenumber of result sets has decreased and the number of bucket tables hasincreased, deleting rows in the result sets table of contents forexisting set identifiers, recalculating values in the bucket tablecolumn of the result sets table of contents for remaining setidentifiers to determine which bucket table is to store which resultset, and creating one or more bucket tables.
 13. The article ofmanufacture of claim 12, wherein the operations further comprise:receiving input from the system administrator indicating that the numberof result sets has increased and that the number of bucket tables isunchanged; and in response to determining that the input received fromthe system administrator indicates that the number of result sets hasincreased and the number of bucket tables is unchanged, inserting rowsinto the result sets table of contents to enable storage of additionalresult sets.
 14. The article of manufacture of claim 12, wherein theoperations further comprise: receiving input from the systemadministrator indicating that the number of result sets has decreasedand that the number of bucket tables is unchanged; and in response todetermining that the input received from the system administratorindicates that the number of result sets that may be stored is decreasedand the number of bucket tables is unchanged, deleting rows in theresult sets table of contents.
 15. The article of manufacture of claim12, wherein the operations further comprise: receiving input from thesystem administrator indicating that the number of result sets isunchanged and that the number of bucket tables is changed; and inresponse to determining that the input received from the systemadministrator indicates that the number of result sets is unchanged andthe number of bucket tables has changed, recalculating values in thebucket table column of the result sets table of contents by determiningwhich bucket table is to hold each of the one or more result sets basedon a set identifier associated with each result set modulo the number ofbuckets that may hold result sets.
 16. The article of manufacture ofclaim 12, wherein the operations further comprise: receiving input fromthe system administrator indicating that the number of result sets hasdecreased and that the number of bucket tables has decreased; and inresponse to determining that the input received from the systemadministrator indicates that the number of result sets has decreased andthe number of bucket tables has decreased, deleting rows in the resultsets table of contents for existing set identifiers, recalculatingvalues in the bucket table column of the result sets table of contentsfor remaining set identifiers, dropping one or more bucket tables, andremoving result sets contained in the dropped bucket tables.
 17. Thearticle of manufacture of claim 12, wherein the operations furthercomprise: receiving input from the system administrator indicating thatthe number of result sets has increased and that the number of buckettables has increased; and in response to determining that the inputreceived from the system administrator indicates that the number ofresult sets has increased and the number of bucket tables has increased,recalculating values in the bucket table column of the result sets tableof contents for existing set identifiers, creating one or more buckettables, and inserting additional rows into the result sets table ofcontents.
 18. The article of manufacture of claim 12, wherein theoperations further comprise: receiving a request for a result setholding content at a point in time; and returning the result set withoutre-executing a query from which the result set was generated.
 19. Thearticle of manufacture of claim 12, wherein the operations furthercomprise: receiving a request to execute a query that has been storedfor one of the result sets that has been stored; and executing the queryto generate a new result set.
 20. The article of manufacture of claim12, wherein the result set management is performed at one of a datastore engine, a web application server that communicates with the datastore engine, and on separate multiple servers.
 21. The article ofmanufacture of claim 12, wherein the result sets may be stored in one ormore data stores at one or more server computers.
 22. The article ofmanufacture of claim 12, wherein the operations further comprise: whenat least one of the number of result sets that may be stored and thenumber of bucket tables that may hold result sets is modified, mappingexisting result sets to set identifiers and bucket tables based on themodification, without moving contents of the existing result sets.